<template>
  <div>
    我是分类
    <Swiper>
         <van-swipe-item v-for="(image, index) in images" :key="index">
             <img v-lazy="image" style="height:250px"/>
         </van-swipe-item>
    </Swiper>
    <Top :sned="arr"></Top>
    <div v-if="arr[index]">
         <Bottom :arr="arr[index].child"></Bottom>
    </div>
   

    <!-- <van-swipe :autoplay="3000"> -->
     
    <!-- </van-swipe> -->
  </div>
</template>

<script>
import Swiper from "./swiper.vue"
import Top from "../components/top.vue"
import Bottom from "../components/bottom.vue" 
import Vue from 'vue';
import { Lazyload } from 'vant';
Vue.use(Lazyload);
export default {
     data() {
         return {
      images: [
        'https://img01.yzcdn.cn/vant/apple-1.jpg',
        'https://img01.yzcdn.cn/vant/apple-2.jpg',
      ],
      arr:[],
      index:0

    };
  },
  components:{
      Swiper,
      Top,
      Bottom
  },
   mounted(){
         this.$axios.get("/list").then(({data})=>{
             console.log(data);
             this.arr = data
         })
     },
};
</script>

<style>
</style>